<template>
    <div class="w-full h-100vh flex-center">
        <n-result
            status="404"
            title="404 资源不存在"
            description="你可能需要换种打开方式"
        >
            <template #footer>
                <n-button @click="goBack">返回</n-button>
            </template>
        </n-result>
    </div>
</template>

<script lang="ts" setup>
import { useRouter } from "vue-router";

const router = useRouter();

const goBack = () => {
    // if (!router.options.history.state.back) {
    //     if (
    //         router.getRoutes().find((item) => {
    //             item.path === "/layout/index";
    //         })
    //     ) {
    //         router.replace({ path: "/layout/index" });
    //     } else {
    //         router.replace({ path: "/login", force: true });
    //     }
    // } else {
    //     router.replace({ path: router.options.history.state.back });
    // }
};
</script>

<style scoped>
* {
    user-select: none;
}
</style>
